package com.xyy.saas.payment.cores.enums;

import lombok.Getter;

/**
 * @author wangzeqi
 */
@Getter
public enum AbchinaLoanOrderStatusEnum {

    UNPAID("0", "待支付"),
    CANCEL1("1", "下单人已取消"),
    CANCEL2("2", "支付人已取消"),
    PAID("3", "完成支付"),
    RETURNING("4", "退货退款中"),
    RETURNED("5", "已退货退款"),
    ;

    private final String code;
    private final String value;


    AbchinaLoanOrderStatusEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static AbchinaLoanOrderStatusEnum fromCode(String code) {
        if (code == null || code.isEmpty()) {
            return null;
        }
        for (AbchinaLoanOrderStatusEnum status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        return null;
    }

}
